package com.niit.onlinemusic.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.niit.onlinemusic.model.domain.RankList;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

/**
 * 歌单评分数据访问层
 *
 * @author zuwei522
 * @since 2025/9/29 22:52
 */
@Mapper
public interface RankListMapper extends BaseMapper<RankList> {

    /**
     * 查询指定用户对某个歌单的评分
     *
     * @param consumerId 用户id
     * @param songListId 歌单id
     * @return 评分
     * @author zuwei522
     * @since 2025/9/29 23:06
     */
    Integer selectUserRank(@Param("consumer_id") Long consumerId,
                           @Param("song_list_id") Long songListId);

    /**
     * 查询某个歌单的评分总和
     *
     * @param songListId 歌单id
     * @return 评分总和
     * @author zuwei522
     * @since 2025/9/29 23:19
     */
    Integer selectScoreSum(Long songListId);

}
